#include <boost/test/unit_test.hpp>
#include "../include/vector_operations.h"

BOOST_AUTO_TEST_SUITE(VectorOperationsTests)

BOOST_AUTO_TEST_CASE(test_sum)
{
    BOOST_CHECK_EQUAL(sum({1, 2, 3, 4, 5}), 15);
    BOOST_CHECK_EQUAL(sum({}), 0);
    BOOST_CHECK_EQUAL(sum({-1, -2, -3, -4, -5}), -15);
}

BOOST_AUTO_TEST_CASE(test_average)
{
    BOOST_CHECK_CLOSE(average({1, 2, 3, 4, 5}), 3.0, 0.001);
    BOOST_CHECK_CLOSE(average({5, 5, 5, 5, 5}), 5.0, 0.001);
    BOOST_CHECK_THROW(average({}), std::invalid_argument);
}

BOOST_AUTO_TEST_SUITE_END()
